<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="../../vue.js"></script>
</head>

<body>
  <div id="app">
    <gp13-city v-on:message="receiveChild"></gp13-city>

  </div>

  <script type="text/template" id="temp">
    <div>
       <input type="text" v-model="childmsg" />
       <button @click="sendMsg">send msg</button>
    </div>
  </script>

</body>
<script>

  Vue.component('gp13City', {
    props: ['name'],
    data() {
      return {
        childmsg: ''
      }
    },
    template: "#temp",
    methods: {
      sendMsg() {
        this.$emit('message', this.childmsg)
      }
    }
  })


  var vm = new Vue({
    el: '#app',
    data: {

    },
    methods: {
      receiveChild(msg) {
        console.log(msg)
      }
    }
  })



</script>

</html>